import http from '@/utils/request'
import { MPaginationReq, MPaginationRes } from "@/modules/common"
import { MAd, MQuestion } from "@/modules/system"

class ConfigServiceTemp {
	editAd(ad: MAd) {
		return http.get('/sys/role/menu')
	}
	getAds() {
		return http.get('/sys/role/menu')
	}
	editQuestion(ad: MQuestion) {
		return http.post(`/yxd/oa/faq/${ad.id ? 'update' : 'add'}`, ad)
	}
	getQuestionDetail(id: string) {
		return http.get('/yxd/oa/faq/detail', { params: { id } })
	}
	getQuestiones(pagination: MPaginationReq): Promise<MPaginationRes> {
		return http.post('/yxd/oa/faq/page', pagination).then((res: any) => {
			return Promise.resolve({
				dataList: res.data,
				total: res.total
			});
		})
	}
}

const ConfigService = new ConfigServiceTemp()
export {
	ConfigService
}
